﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Insert_Payment : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public void AddPayment(object s, EventArgs e)
    {
        Payment p = new Payment();
        PaymentBOL pBOL = new PaymentBOL();

        try
        {
            p.PaymentID = txtPaymentID.Text;
            p.ShoppingID = txtShoppingCartID.Text;
            p.Datepayment = DateTime.Now;
            p.PaymentType = DropDownList1.SelectedItem.ToString();
            p.ServiceCharges = Convert.ToDouble(txtServiceCharges.Text);

            int result = pBOL.insertPayment(p);
            if (result > 0)
            {
                Label7.Text = "Insert record is successful!";
            }
            else
                Label7.Text = "Insert record is error";
        }
        catch (Exception ex)
        {
            Label7.Text = ex.Message;
        }
        finally
        {
            p = null;
            pBOL = null;
        }
    }
}